#ifndef SURFACEUTILS_H_
#define SURFACEUTILS_H_

#include "point.h"
#include "model/matrix4x4.h"
#include <vector>

typedef std::vector<Point> Points;

class SurfaceUtils{
	public:

		typedef enum {NONE, CILINDER , BASE } Type;
		// {Cilindro}
		static const unsigned int CILINDER_ANGLES=8;

		// {Base},Debe ser multiplo de 2
		static const unsigned int BASE_POINT_COUNT=8;
	private:
		// {Cilindro}
		static const float RADIO;

		// {Base}
		static const float BASE_HEIGHT;
		static const float BASE_WIDTH;
	public:
		static void calculateSurfacePoints(const Point& vecDir,const Point& point,Points& vectPoints,Points& vectNormal,Type type);
		static void calculateIndices(std::vector<unsigned int>& index, unsigned int size,unsigned int lastIndex,Type type);
		static unsigned int pointsCountByPlane(Type type);
		static void sortVectors(const std::vector<Type>& segmentTypes,unsigned int planeCount,
								Points& vecSurfacePoints,Points& vecNormalSurface);

	private:
		static void calculateCilinderPoints(const Point& vecDir,const Point& point,Points& vectPoints,Points& vectNormal);
		static void calculateBasePoints(const Point& vecDir,const Point& point,Points& vectPoints,Points& vectNormal);

		static void calculateMatrix(Matrix4x4& m,const Point& vecDir,const Point& pos);
};

#endif /* SURFACEUTILS_H_ */
